package cn.scw.framework.task;

import cn.scw.common.utils.StringUtils;
import cn.scw.project.facility.service.IFacFacilityService;
import cn.scw.project.goods.service.IGCouponService;
import cn.scw.project.system.service.ISysUserBrokerageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 *
 * @author api
 */
@Component("ryTask")
public class RyTask {
    @Autowired
    private IGCouponService igCouponService;
    @Autowired
    private IFacFacilityService iFacFacilityService;
    @Autowired
    private ISysUserBrokerageService iSysUserBrokerageService;

    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void ryParams(String params) {
        System.out.println("执行有参方法：" + params);
    }

    public void ryNoParams() {
        System.out.println("执行无参方法");
    }

    public void ryGCoupon() {
        igCouponService.autoUpdIsOverdue();
        System.out.println("执行更新优惠券状态");
    }

    public void ryFacExpire() {
        iFacFacilityService.autoUpdateIsExpire();
        System.out.println("执行更新设备过期状态");
    }

    public void ryBrokeragePay(){
        iSysUserBrokerageService.BrokeragePay();
        System.out.println("执行佣金充值到个人账户");
    }
}
